package viper.diversity;



public class Diversity{
	static byte  [] A;
	static byte  [] B;
	static byte  [] C;
	static byte  [] A_Xor_B;
	static byte  [] A_Xor_C;
	static byte  [] B_Xor_C;
	static byte  [] A_Xor_B_temp;
	static byte  [] A_Xor_C_temp;
	static byte  [] B_Xor_C_temp;
	static byte  [][] Two_Three_x;
	static byte  [][] Four_Six_x;

	public static byte[][] diversify(byte [] one, byte [] two)
	{
		Two_Three_x = new byte [3][];
		A_Xor_B_temp = new byte [one.length];
		for(int i=0;i<one.length;i++){
			A_Xor_B_temp [i]=(byte)(one[i]^two[i]);
					}
		Two_Three_x[0]=one;
		Two_Three_x[1]=two;
		Two_Three_x[2]=A_Xor_B_temp;
		return Two_Three_x;
	}
	public static byte [][] diversify(byte [] one, byte [] two, byte [] three){
		Four_Six_x = new byte [6][];
		A_Xor_B_temp = new byte [one.length];
		A_Xor_C_temp = new byte [two.length];
		B_Xor_C_temp = new byte [three.length];
		for(int i=0;i<one.length;i++){
			A_Xor_B_temp [i]=(byte)(one[i]^two[i]);
		}
		for(int i=0;i<two.length;i++){
			A_Xor_C_temp [i]=(byte)(one[i]^three[i]);
		}
		for(int i=0;i<two.length;i++){
			B_Xor_C_temp [i]=(byte)(two[i]^three[i]);
		}
		Four_Six_x[0]=one;
		Four_Six_x[1]=two;
		Four_Six_x[2]=three;
		Four_Six_x[3]=A_Xor_B_temp;
		Four_Six_x[4]=A_Xor_C_temp;
		Four_Six_x[5]=B_Xor_C_temp;
		return Four_Six_x;	
	}

}


